package buttons;

import javax.swing.*;
import javax.swing.event.*;
import controller.Controller;
import util.commands.Command;

public class slider<T>
{
    final JSlider animationSlider;
    Controller myController;

    public slider(int min, int max, int value, Controller controller)
    {
        myController = controller;
        animationSlider = new JSlider(JSlider.HORIZONTAL, min, max, value);
        animationSlider.addChangeListener(new ChangeListener()
        {
            public void stateChanged(ChangeEvent e)
            {
                /*
                 * TODO: If we actually implement this, do something here!
                 */
                // myController.displayFrame(getCurrentValue());
            }
        });
    }

    private int getCurrentValue()
    {
        return animationSlider.getValue();
    }

    public JSlider getInstance()
    {
        return animationSlider;
    }
}